//
//  NumberSprite.h
//  StarBugs
//
//  Created by ?? ? on 2/14/12.
//  Copyright 2012 antisword@playorca.com. All rights reserved.
//

#ifndef __NUMBERSPRITE_H__
#define __NUMBERSPRITE_H__
#include "cocos2d.h"

enum{
    number_type_1,
    number_type_2,
    number_type_3,
    number_type_result,
};

enum{
    align_left,
    align_center,
    align_right,
};

namespace cocos2d {
class NumberSprite : public CCNode{
    
public:
    NumberSprite(int number, int type, int _align, bool plus, ccColor3B color);
    ~NumberSprite();
    void startAni(CCPoint pt);
    void startCountAni(CCPoint pt, int pre, int last);
//    void setNumberColor(ccColor3B color);
private:
    CCSprite *mainSprite;
//    void setNumber(int num, int _align, bool plus);
    void setNumber(int num);
    void _call();
    void countTick(float dt);
    
    int width;
    int height;
    char txt[32];
    
    int score;
    int preScore;
    int lastScore;
    float maxTimer;
    float timer;
    ccColor3B numberColor;
    
    int m_align;
    bool m_plus;
    
};
}

#endif//__NUMBERSPRITE_H__